#!/bin/sh

export XDG_DATA_DIRS="/opt/qt4/share:/opt/kde4-deps/share:/opt/kde4/share:/usr/share:$XDG_DATA_DIRS"
export PATH="/opt/qt4/bin:/opt/kde4-deps/bin:/opt/kde4/bin:$PATH"
DBUS_UUIDGEN="$3/opt/kde4-deps/bin/dbus-uuidgen"
if [ -x "$DBUS_UUIDGEN" ]; then
	$DBUS_UUIDGEN --ensure >"/tmp/$$-dbus-uuidgen.log" 2>&1 || :
fi

if [ -x "/opt/kde4-deps/share/djvu/osi/desktop/register-djvu-mime" ]; then
	/opt/kde4-deps/share/djvu/osi/desktop/register-djvu-mime install >"/tmp/$$-register-djvu-mime.log" 2>&1 || :
fi

if [ -x "/opt/kde4-deps/bin/update-mime-database" ]; then
	/opt/kde4-deps/bin/update-mime-database -V /opt/kde4-deps/share/mime >"/tmp/$$-update-mime-database.log" 2>&1 || :
fi

/bin/launchctl stop org.freedesktop.dbus                                         >/tmp/$$-dbus.log 2>&1 || :
/bin/launchctl stop org.freedesktop.dbus-session                                >>/tmp/$$-dbus.log 2>&1 || :
/bin/launchctl load -w /Library/LaunchDaemons/org.freedesktop.dbus.plist        >>/tmp/$$-dbus.log 2>&1 || :
/bin/launchctl load -w /Library/LaunchAgents/org.freedesktop.dbus-session.plist >>/tmp/$$-dbus.log 2>&1 || :
/bin/launchctl start org.freedesktop.dbus                                       >>/tmp/$$-dbus.log 2>&1 || :
/bin/launchctl start org.freedesktop.dbus-session                               >>/tmp/$$-dbus.log 2>&1 || :
